home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
me_cd22.zip
/
MUTT2.ZIP
/
MAILMODE.MUT
< prev
next >
Wrap
Text File
|
1992-04-27
|
2KB
|
66 lines
;; mailmode.mut : Stuff for replying to or composing mail/notes messages.
;; A super set of text mode.
;; Routines:
;; mail-quote-region:
;; Put a symbol infront of each line of text (ignore empty lines) in
;; the region to indicate that somebody else wrote it.
;; C Durland Public Domain
(const quoter "> ") ;; what to put in front of quoted text
(defun
mail-mode
{
(text-mode)
(minor-mode "Mail")
(bind-local-key "mail-format-quote-region" "M-`")
(if (pgm-exists "mail-mode-hook") (floc "mail-mode-hook"()))
}
)
(include me2.h)
(include runblock.mut)
(defun
what-do-you-want-to-quote-with (bool ask-them) HIDDEN
{
(if ask-them
; { (ask-user) (concat (ask "what do you want to quote with? ") quoter) }
{ (ask-user) (ask "what do you want to quote with? ") }
quoter
)
}
mail-quote-region { (run-pgm-on-block (floc quote-a-line-of-text) quoter) }
mail-format-quote-region
{
(byte type)(small-int left-edge width height)(int size) ;; RegionInfo
(int mark-id)
(string the-quote)
(region-stats (loc type) THE-DOT THE-MARK TRUE)
(the-quote (what-do-you-want-to-quote-with (arg-flag)))
(set-mark (mark-id (create-mark)))
(adjust-lines height
(- (if (== 0 (word-wrap)) 72 (word-wrap)) (length-of the-quote))
FALSE)
(forward-line -1)(set-mark)
(goto-mark mark-id)(free-mark mark-id)
(run-pgm-on-block (floc quote-a-line-of-text) the-quote)
}
)
;;;;;;;;;;;;;;;;;;;;;;;;; details ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun
quote-a-line-of-text (string quoter) HIDDEN
{
(if (looking-at '\ *$')
{ (arg-prefix 1)(cut-line)(open-line) } ;; clear blank line
(insert-text quoter)) ;; add the quote mark
}
)